<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f(x) {
            var ta = document.getElementById("ta");
            var td = ta.getElementsByTagName("td");
            if (x.value == "显示全部品牌") {
                td[5].innerHTML = "荣耀";
                ta.innerHTML += " <tr>\n" +
                    "        <td>红米</td>\n" +
                    "        <td>realme</td>\n" +
                    "        <td>iQOO</td>\n" +
                    "    </tr>";
                x.value = "精简显示品牌";
            } else {
                ta.innerHTML = " <tr>\n" +
                    "        <td>苹果</td>\n" +
                    "        <td>华为</td>\n" +
                    "        <td>小米</td>\n" +
                    "    </tr>\n" +
                    "    <tr>\n" +
                    "        <td>oppo</td>\n" +
                    "        <td>vivo</td>\n" +
                    "        <td>其他品牌手机</td>\n" +
                    "    </tr>";
                x.value = "显示全部品牌";
            }
        }
    </script>
</head>
<body>
<table id="ta" border="0" width="50%">
    <tr>
        <td>苹果</td>
        <td>华为</td>
        <td>小米</td>
    </tr>
    <tr>
        <td>oppo</td>
        <td>vivo</td>
        <td>其他品牌手机</td>
    </tr>
</table>
<input type="button" value="显示全部品牌" onclick="f(this)"/>
</body>
</html>